package main 

import "fmt"

func main(){
	var result = fibonacci()
	for i := 0; i <= 10; i++ {
		fmt.Printf("fibonacci(%d) is: %d\n", i, result())
	}
}

func fibonacci() func() int{
	var x, y = 1, 0
	return func() int {
			x, y = y, x + y		
		return y
	}
}